var express = require('express');
var router = express.Router();
var fs = require('fs');
var path = require('path');
// var HandleDB = require('../tool/db');

var noteCtrl = require('../controllers/noteCtrl');
router.get('/cateHome', function (req, res) {

    return res.redirect(303, '/views/cateHome.html');
});
router.get('/itemHome', function (req, res) {

    return res.redirect(303, '/views/itemHome.html');
});


router.get('/cates/', noteCtrl.getCate);
router.post('/cates/add', noteCtrl.addCate);
router.post('/cates/update', noteCtrl.updateCate);
router.get('/cates/delete', noteCtrl.removeCate);

router.get('/items/', noteCtrl.getItem);
router.post('/items/add', noteCtrl.addItem);
router.post('/items/update', noteCtrl.updateItem);

router.get('/articles/', noteCtrl.getArticle);
router.get('/articles/:id', noteCtrl.getOneArticle);
router.post('/articles/add', noteCtrl.addArticle);
// router.post('/articles/update', noteCtrl.updateArticle);



module.exports = router;
